<?php /* @var $gallery Gallery */ ?>

<div class="title">
    <?php echo $title ?>
</div>

<?php if( !empty( $galleries ) ): ?>

<div>
    <?php foreach( $galleries as $gallery ): ?>
        <div class="event_div">
            <div class="event_title">
                <div style="float: left;">
                    <?php if( get_user_id() ): ?>
                        <?php echo link_to(
                                        image_tag(
                                            'pencil.png'
                                            , array(
                                                'border' => '0'
                                                , 'alt' => __('Edit')
                                                , 'title' => __('Edit')
                                            )
                                        )
                                        , '/gallery/edit?id=' . $gallery->getId()
                                    ) ?>
                    <?php endif; ?>
                </div>
                <?php echo link_to($gallery->getName(), '#') ?>
            </div>
            <div class="event_gallery">
                <div class="gallery_image">
                    <table width="200" height="150"><tr><td align="center" valign="middle">
                    <?php echo link_to(
                                image_tag(
                                    '/images/gallery/tiny/' . $gallery->getFirstPhoto('tiny')->getUname()
                                    , array(
                                        'border' => '0'
                                        , 'alt' => $gallery->getName()
                                        , 'title' => $gallery->getName()
                                    )
                                )
                                , '/gallery/display?id=' . $gallery->getId()
                    ) ?>
                    </td></tr></table>
                </div>
            </div>
        </div>
    <?php endforeach; ?>
</div>

<?php else: ?>
    <?php echo __('No results') ?>.
<?php endif; ?>
